﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using SMBL.Operation;
using SMBL.Interface.Database;

/// <summary>
/// 用于Query测试参数化
/// </summary>
public class TestDBOp : DBOperation
{
    private ISql theSql;
    private DataSet ds;

    public DataSet Ds
    {
        get { return ds; }
        set { ds = value; }
    }
    public TestDBOp()
    {

    }

    public override void processDelegate( )
    {
        ds = myProcessor.Query(theSql);
        // base.processDelegate( );
    }
    /// <summary>
    /// 
    /// </summary>
    /// <param name="dbName">绑定数据库名</param>
    /// <param name="Key">需参数化的参数</param>
    /// <param name="Value">需参数化的值</param>
    /// <param name="toSql">需参数化的sql语句</param>
    /// <returns></returns>
    public static DataSet getresult(String dbName,Object[] Key,Object[] Value,String toSql)
    {
        TestDBOp testDbOp = new TestDBOp();
        testDbOp.theSql = new Testsql(Key, Value, toSql);
        testDbOp.myBindDBName = dbName;
        testDbOp.Do();
        return testDbOp.Ds;
    }
}
